package vista;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Vjuez extends javax.swing.JFrame {
	private JPanel Pjuez;
	private JLabel lblcedula;
	private JLabel lblapellido;
	private JTextField txtcompetencias;
	private JButton btnRegistrar;
	private JTextField txtfecha;
	private JTextField txtapellido;
	private JTextField txtnombre;
	private JTextField txtcedula;
	private JLabel lblcantidad;
	private JLabel lblfecha;
	private JLabel lblnombre;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public Vjuez() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.setTitle("Registro de Juez\n");
			{
				Pjuez = new JPanel();
				getContentPane().add(Pjuez);
				//Pjuez.setLayout(PjuezLayout);
				Pjuez.setBounds(0, 0, 413, 276);
				Pjuez.setLayout(null);
				{
					lblcedula = new JLabel();
					Pjuez.add(lblcedula);
					lblcedula.setText("Cedula:");
					lblcedula.setBounds(30, 20, 73, 15);
				}
				{
					lblnombre = new JLabel();
					Pjuez.add(lblnombre);
					lblnombre.setText("Nombre:");
					lblnombre.setBounds(30, 59, 79, 15);
				}
				{
					lblapellido = new JLabel();
					Pjuez.add(lblapellido);
					lblapellido.setText("Apellido:");
					lblapellido.setBounds(30, 98, 73, 15);
				}
				{
					lblfecha = new JLabel();
					Pjuez.add(lblfecha);
					lblfecha.setText("Fecha de Nacimiento:");
					lblfecha.setBounds(28, 132, 136, 15);
				}
				{
					lblcantidad = new JLabel();
					Pjuez.add(lblcantidad);
					lblcantidad.setText("Competencias juzgadas:");
					lblcantidad.setBounds(22, 178, 215, 15);
				}
				{
					txtcedula = new JTextField();
					Pjuez.add(txtcedula);
					txtcedula.setBounds(121, 17, 114, 22);
				}
				{
					txtnombre = new JTextField();
					Pjuez.add(txtnombre);
					txtnombre.setBounds(121, 56, 114, 22);
				}
				{
					txtapellido = new JTextField();
					Pjuez.add(txtapellido);
					txtapellido.setBounds(121, 95, 114, 22);
				}
				{
					txtfecha = new JTextField();
					Pjuez.add(txtfecha);
					txtfecha.setBounds(235, 129, 83, 22);
				}
				{
					txtcompetencias = new JTextField();
					Pjuez.add(txtcompetencias);
					txtcompetencias.setBounds(234, 175, 104, 22);
					txtcompetencias.setEnabled(false);
					txtcompetencias.setEditable(false);
				}
				{
					btnRegistrar = new JButton();
					Pjuez.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(164, 219, 104, 22);
				}
			}
			pack();
			this.setSize(423, 310);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
public String getnombre(){
	return txtnombre.getText();
}
public String getcedula(){
	return txtcedula.getText();
}
public String getapellido(){
	return txtapellido.getText();
}
public String getfecha() {
	return txtfecha.getText();
}
public String getcompetencia(){
	return txtcompetencias.getText();	
}	
public void addListener(ActionListener action){
	btnRegistrar.addActionListener(action);
}

public void mensaje(String string) {
	JOptionPane.showMessageDialog(this, string);
	// TODO Auto-generated method stub
	
}

public void Limpiar() {
	// TODO Auto-generated method stub
	txtapellido.setText("");
	txtcedula.setText("");
	txtcompetencias.setText("");
	txtfecha.setText("");
	txtnombre.setText("");
}	
}

